<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>事件--百度搜索风云榜      </title>
<base href="<?=base_url()?>"/>
<script type='text/javascript' src='js/jquery-1.4.2.min.js'></script> 
</head>
<body>

<a href="javascript:void(0)">
<img id="authcode"src="<?php echo site_url("imgauthcode/show");?>" onclick="refresh('/imgauthcode/show')"/></a>
<a href="javascript:void(0)" onclick="refresh()">点击刷新验证码</a>
<?php 
	$data = array(
              'name'        => 'authcode_input',
              'id'          => 'authcode_input',
              'value'       => '',
              'onblur'       => 'ajaxauth()',
            );
	echo form_input($data);
	echo form_submit('mysubmit','Submit Post!');
	echo form_close();
?>
<span id="authcode_result"></span>
<script lang="javascript">
function refresh()
{
var url='<?php echo site_url()."/imgauthcode/show/";?>'+Math.random();
$('#authcode').attr('src', url);
}
function ajaxauth()
{
var authcode = $('#authcode_input').val();
$.get("<?php echo site_url()."/imgauthcode/check/";?>"+authcode, function(data){
  if(data)
  {
	$('#authcode_result').text("正确");
  }
  else
  {
	$('#authcode_result').text("错误");
  }
}); 
}
</script>
</body>
</html>